import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [{
      path: '/',
      component: resolve => require(['@/components/home/home'], resolve)
    },
    {
      path: '/blog',
      component: resolve => require(['@/components/blog/blog'], resolve)
    },
    {
      path: '/content/:id',
      component: resolve => require(['@/components/content/content'], resolve),
      props: true
    },
    {
      path: '/about',
      component: resolve => require(['@/components/about/about'], resolve)
    },
    {
      path: '*',
      component: resolve => require(['@/base/404'], resolve)
    },
    {
      path: '/series/:id',
      component: resolve => require(['@/components/series/series'], resolve),
      props: true
    },
    {
      path: '/label',
      component: resolve => require(['@/components/label/label'], resolve),
      props: (route) => ({
        id: route.query.id,
        title: route.query.title
      })
    }
  ],
  scrollBehavior(to, from, savedPosition) {
    return { x: 0, y: 0 }
  }
})